import { NodeData } from "../model/NodeModel"

/**
 * 节点类型
 */
export const NodeTypeList: string[]  = ['git', 'maven', 'docker', 'k8s', 'ssh', 'sftp', 'nodejs', 'gradle', 'oss']

/**
 * 节点模版数据
 */
export const nodeTemplateList: NodeData[] = [
  {
    id: '',
    title: '克隆代码',
    type: 'git',
    status: 'init',
    data: {
      url: '',
      secretName: '',
      defaultBranch: 'master',
      branch: ''
    }
  },
  {
    id: '',
    title: '打包代码',
    type: 'maven',
    status: 'init',
    data: {
      command: 'clean package -U -DskipTests',
      mavenHome: '',
      pomPath: ''
    }
  },
  {
    id: '',
    title: '构建镜像',
    type: 'docker',
    status: 'init',
    data: {
      name: '',
      tag: '',
      registry: '',
      dockerFile: 'Dockerfile',
      buildPath: '.',
      secretName: '',
      beforeCommand: '',
      afterCommand: '',
      singleCommand: ''
    }
  },
  {
    id: '',
    title: '部署k8s',
    type: 'k8s',
    status: 'init',
    data: null
  },
  {
    id: '',
    title: '执行ssh命令',
    type: 'ssh',
    status: 'init',
    data: {
      secretName: '',
      command: 'pwd',
      singleCommand: ''
    }
  },
  {
    id: '',
    title: '上传文件',
    type: 'sftp',
    status: 'init',
    data: {
      secretName: '',
      remotePath: '',
      localPath: '',
      fileName: '',
      beforeCommand: ''
    }
  },
  {
    id: '',
    title: 'nodejs部署',
    type: 'nodejs',
    status: 'init',
    data: {
      command:''
    }
  },
  {
    id: '',
    title: 'gradle构建',
    type: 'gradle',
    status: 'init',
    data: {
      command:''
    }
  },
  {
    id: '',
    title: 'oss上传',
    type: 'oss',
    status: 'init',
    data: {
      path:''
    }
  }
]